<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>login</title>
		<link rel="stylesheet" href="../layui/css/layui.css" />
		<script src="../js/jquery.min.js"></script>
		<script type="text/javascript" src="../layui/layui.js"></script>
		<style>
			body {
				background-image: url(../img/bjt.JPG);
				background-position: top;
				background-size: cover;
				background-repeat: no-repeat;
				background-attachment: fixed;
			}
			
			.login-wapper {
				background: rgba(255, 255, 255, 0.2);
				position: fixed;
				height: 300px;
				width: 350px;
				left: 75%;
				top: 50%;
				margin-top: -150px;
				margin-left: -175px;
				border: 1px solid #D5D5D5;
				padding: 40px 80px 0px;
			}
			.layui-tab-title li{
				font-size: 18px;
				font-weight: 700;
				color: #E6E6E6;
			}
		</style>
		<script>
			window.onload = function() {
				layui.use(["form", "element"], function() {
					$("#login-btn").click(function(){
						var username = $("#username").val();
						var userpwd = $("#userpwd").val();
						if(username!=""&&userpwd!=""){
							$.ajax({
								type:"post",
								url:"http://localhost:8080/ImServer/login",
								data:{
									username:username,
									userpwd:userpwd
								},
								success:function(result){
									document.location.href="http://localhost:8080/ImServer/layui/page/im.html";
								}
							});
						}
					});
				});
			}
		</script>
	</head>

	<body>
		<div class="layui-container">
			<div class="login-wapper">
				<div class="layui-tab layui-tab-brief">
					<ul class="layui-tab-title">
						<li class="layui-this">用户登录</li>
						<li>用户注册</li>
					</ul>
					<div class="layui-tab-content">
						<form id="login-form" class="layui-form layui-form-pane">
							<div class="layui-form-item">
								<label class="layui-form-label">用户名</label>
								<div class="layui-input-block">
									<input id="username" name="username" class="layui-input" type="text" />
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">密码</label>
								<div class="layui-input-block">
									<input id="userpwd" name="userpwd" class="layui-input" type="password" />
								</div>
							</div>
							<div class="layui-row">
								<button id="login-btn" class="layui-btn layui-btn-normal layui-col-xs12" type="button">登录</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</body>

</html>